<style>
body {
	text-align:center;
	margin:0px;
}

#staff_unwork_time_content {
	position: absolute;
	z-index: auto;
	height: auto;
	width: 1000px;
	left:0px;
	top:80px;
}
#staff_unwork_time_menu {
	width:400px;
	padding-left:20px;
	height:auto;
	text-align:left;

	
}
#staff_unwork_time_top {
	width:900px;
	height:auto;
	margin-top:10px;
	padding-left:50px;
	text-align:left;
	font-family:"ＭＳ Ｐゴシック", "ＭＳ ゴシック", "ＭＳ Ｐ明朝", "ＭＳ 明朝", "MS UI Gothic";
	font-size:14px;
}


#staff_unwork_time_content #staff_unwork_time_top table {
	font-family: "ＭＳ Ｐゴシック", "ＭＳ ゴシック", "ＭＳ Ｐ明朝", "ＭＳ 明朝", "MS UI Gothic";
	font-size: 12px;
	text-align: center;
}
</style>

	<!--{include /service/service_head}-->
	<div id="staff_unwork_time_content">
	<div id="staff_unwork_time_menu">
		<ul style="padding-left : 8px, left : 0, ">
			${staffmanage_backend($oauthMap)}
		</ul>
	</div>
	
	<div id="staff_unwork_time_top">
		<form action="/service/staffUnWorkTime.php" id="indexform" method="get">
		店舗<select name="shop_id" class="f-city">
				<option value="0">選択してください</option>
				${Utility::Option(Utility::OptionArray($shopList, 'id', 'shop_name'), $defaultShopId)}
			</select><BR><BR>
			登録開始時間
			<select name="time[startMonth]" class="f-city">
				<option value="0">選択してください</option>
				${Utility::CommonOption($monthList, $time['startMonth'])}
			</select>月
			<select name="time[startDay]" class="f-city">
				<option value="0">選択してください</option>
				${Utility::CommonOption($dayList, $time['startDay'])}
			</select>日<BR>
			～<BR>登録終了時間
			<select name="time[endDay]" class="f-city">
				<option value="0">選択してください</option>
				${Utility::CommonOption($dayList, $time['endDay'])}
			</select>日
			<input type="submit" name="" value="検索" />
		</form>
		<table border="1" cellpadding="1" cellspacing="0" width="900">
		<tr>
			<td width="90">
				スタッフ名
			</td>
			<!--{loop $workDayList $index $one}-->
			<td>
				{$one}日			<!--{if $workDayofWeekList[$index] == "土"}-->
					<font color="blue">({$workDayofWeekList[$index]})</font>
				<!--{elseif $workDayofWeekList[$index] == "日"}-->
					<font color="red">({$workDayofWeekList[$index]})</font>
				<!--{else}-->
					({$workDayofWeekList[$index]})
				<!--{/if}-->
			</td>
			<!--{/loop}-->
			
		</tr>
		<!--{loop $staffList $index $one}-->
		<tr>
			<td>
				<font size="2">{$one['family_name']} {$one['personal_name']}</font>
			</td>
			<form action="/service/addUnWorkTime.php" method="post" succ="test" name="addWorkTime">
			<input type="hidden" name="month" value="{$time['startMonth']}"/>
			
			<input type="hidden" name="staffId" value="{$one['id']}"/>
			<!--{loop $workDayList $index1 $one1}-->
			
			<td>
				<input type="hidden" name="day[]" value="{$one1}"/>
				<!--{if $workScheduleStaffId[$one['id']][$one1] != null}-->
				<select name="startHour_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $hourList, date('H',$workScheduleStaffId[$one['id']][$one1][0]['start_time']) )}
				</select>
				<select name="startMinute_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $minuteList, date('i',$workScheduleStaffId[$one['id']][$one1][0]['start_time']) )}
				</select>
				<select name="endHour_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $hourList, date('H',$workScheduleStaffId[$one['id']][$one1][0]['end_time']) )}
				</select>
				<select name="endMinute_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $minuteList, date('i',$workScheduleStaffId[$one['id']][$one1][0]['end_time']) )}
				</select>
				<!--{else}-->
				<select name="startHour_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $hourList, 0 )}
				</select>
				<select name="startMinute_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $minuteList, 0 )}
				</select>
				<select name="endHour_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $hourList, 0 )}
				</select>
				<select name="endMinute_{$one['id']}[]" class="f-city" onchange="copy2Next({$time['startDay']}, {$one1}, this)">
					<option value="0">--</option>
					${Utility::CommonOption( $minuteList, 0 )}
				</select>
				<!--{/if}-->
			</td>
			<!--{/loop}-->
			<td>
			<input type="submit" value="追加">
			</td>
			</form>
		</tr>
		<!--{/loop}-->
		</table>
	<div>
	</div>
</body>
</html>
<script type="text/javascript"><!-- 
function test(val){
	val = eval("(" +  val + ")");
	if( val.error != 0 ){
		alert(val.data);
	}else{
		alert("全部追加しました");
	}
}
function copy2Next(judgeDay, currentDay, obj){
	/*if( currentDay != judgeDay ){
		return ;
	}
	var objName = $(obj).attr('name');
	$(obj).parents('tr').find("select[name='" + objName + "']").val( $(obj).val() );
	*/
	
}
	jQuery(function(){
		 //onkeypress="onNameKeyPress(window.event)";
		/*$("select[name='shop_id']").bind("change", function(){
			
			$("#indexform").submit();
		});*/
		new AjaxFormManager($("form[name='addWorkTime']"));
	});
--></script> 
</html> 